package comp3021.a1;

import java.util.ArrayList;

public class UserList {
		protected ArrayList <Base> ulist = new ArrayList<Base>();
		public UserList() 
		{
		}
		public UserList(String filename){
		 try{
			 java.io.File file = new java.io.File(filename);
			 java.util.Scanner input = new java.util.Scanner(file);
			 // Read data from a file
	 			while(input.hasNextLine())
	 			{	
	 				Base u = new Base();
	 				u.setName(input.next());
	 				u.setKey(input.next());
	 				ulist.add(u);
	 			}
	 		input.close();  
		 }
		 catch (Exception UserListError)
		 {
			 System.out.println("User data cannot be accessed");
		 }
		}
	}
